//
//  HSTestThreeViewController.m
//  HSToolKit_Example
//
//  Created by huang on 2018/9/29.
//  Copyright © 2018年 772729579@qq.com. All rights reserved.
//

#import "HSTestThreeViewController.h"
#import "HSTestOneViewController.h"
#import "UINavigationBar+Awesome.h"

@interface HSTestThreeViewController ()

@end

@implementation HSTestThreeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    UIButton *testButton = [UIButton buttonWithType:UIButtonTypeCustom];
    testButton.frame = CGRectMake(100, 100, 200, 100);
    testButton.backgroundColor = [UIColor colorWithRed:arc4random_uniform(256.0)/256.0f green:arc4random_uniform(256)/256.0f blue:arc4random_uniform(256)/256.0f alpha:1.0f];
    [testButton addTarget:self action:@selector(testButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
    [testButton setTitle:@"TestTwo" forState:UIControlStateNormal];
    [self.view addSubview:testButton];
    
    self.view.backgroundColor = [UIColor colorWithRed:arc4random_uniform(256.0)/256.0f green:arc4random_uniform(256)/256.0f blue:arc4random_uniform(256)/256.0f alpha:1.0f];
    
    self.navigationItem.title = @"TestThree";
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    [self.navigationController.navigationBar hs_setNavigationBackgroundAlpha:0];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];

    [self.navigationController.navigationBar hs_setNavigationBackgroundAlpha:1.0];
}

- (void)testButtonClicked:(UIButton *)sender
{
    HSTestOneViewController *test = [[HSTestOneViewController alloc] init];
    [self.navigationController pushViewController:test animated:YES];
}

@end
